package com.ysd.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ysd.entity.Shopping;
import com.ysd.service.ShoppingService;

@Controller
public class ShippingController {
	
	@Autowired
	private ShoppingService shoppingService;
	
	@RequestMapping("getShopping")
	@ResponseBody
	public Object getShopping(Shopping shopping) {
		List<Shopping> list = shoppingService.findShoppings(shopping);
		return list;
	}
	
	@RequestMapping("updateShoppingAdd")
	@ResponseBody
	public int updateShoppingAdd(int id) {
		int n = shoppingService.updateShoppingAdd(id);
		return n;
	}
	
	@RequestMapping("updateShoppingReduce")
	@ResponseBody
	public int updateShoppingReduce(int id) {
		int n = shoppingService.updateShoppingReduce(id);
		return n;
	}
	
	@RequestMapping("delShoppingById")
	@ResponseBody
	public int delShoppingById(int id) {
		int n = shoppingService.delShoppingById(id);
		return n;
	}
	
	@RequestMapping("delShoppingByIds")
	@ResponseBody
	public int delShoppingByIds(String ids) {
		int n = shoppingService.delShoppingByIds(ids);
		return n;
	}
}
